home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / sputls.zip / HASMOUSE.DOC < prev    next >
Text File  |  1991-01-06  |  2KB  |  70 lines

  1. Has Mouse   version 1.0 (C) SPETER SOFTWARE,   January 1991.
  2.  
  3.    This program will return an errorlevel to indicate the presence of
  4.    a (Microsoft compatible) mouse.  The utility could be used in batch
  5.    files to execute alternate programs depending on the availability of
  6.    a mouse.
  7.  
  8.    The program was written in Borland's Turbo Pascal 5.5
  9.  
  10. Usage:
  11. ------
  12. 1:   HASMOUSE /h
  13.  
  14.         Output a help screen.
  15.  
  16. 2:   HASMOUSE
  17.  
  18.         Set the DOS errorlevel (environment variable) according to whether the
  19.         program is able to detect the presence of an installed mouse.
  20.  
  21.           sets errorlevel = 0 if no mouse found
  22.           sets errorlevel = 1 if a mouse was found
  23.  
  24. Examples:
  25. --------
  26. The following are batch files that display a message informing the user if a
  27. mouse was detected:
  28.  
  29. 1:     hasmouse
  30.        if errorlevel 1 goto mouseOK
  31.        if errorlevel 0 echo "no mouse was found"
  32.        goto end
  33.        :mouseOK
  34.        echo "a mouse was found"
  35.        :end
  36.  
  37. The commands above are useful if you only have one mouse specific section in
  38. the batch file;  otherwise, it is usually simpler to set an environment
  39. variable (as in example 2).
  40.  
  41. NOTE  that the DOS echo command will reset the errorlevel variable.
  42.  
  43. 2:     set UseMouse=
  44.        hasmouse
  45.        if errorlevel 1 set UseMouse=T
  46.        if %UseMouse%=T echo   A mouse was found
  47.        if not %UseMouse%=T echo   A mouse was NOT found
  48.  
  49. Set an environment variable if you want to know if a mouse is available in more
  50. than one place in batch files.  Remember to remove the environment variable
  51. (see the first line of example 2), when you are finished using it, or at the
  52. end of the batch file.
  53.  
  54. Correspondence:
  55. ---------------
  56.     Please address any comments to:
  57.  
  58.         Stephen Peter
  59.  
  60.     INTERNET:
  61.         steve@cad0.arch.unsw.oz.au
  62.  
  63.     POST:
  64.         SPETER SOFTWARE
  65.         P.O. BOX 643
  66.         LANE COVE
  67.         NSW  2066
  68.         AUSTRALIA
  69.  
  70.